[ToC] [Up] [Back] [Next] ... [Book Plug] The Information Commons
.................... Introduction to HTML

5.1 Comments in HTML

Comment lines are indicated by the special beginning tag <!-- and ending tag --> placed at the beginning and end of EVERY line to be treated as a comment. Comments do not nest, and the double-dash sequence "--" may not appear inside a comment except as part of the closing --> tag. You must also make sure that there are no spaces in the start-of-comment string.

For example, the line

   <!--   This is commented out -->
is a valid comment line, but the line
   < !--   This is commented out -->
is not, since there is a space between the left angle bracket and the exclamation mark.

Do not try to use comments this to "comment out" HTML that would otherwise be shown to the user, since some browsers (notably Mosaic) will still pay attention to angle brackets inside the comment and close it prematurely.

(obtained from the WWW faq list)

[ToC] [Up] [Back] [Next] ... [Book Plug] .................... Introduction to HTML
© Ian Graham 1994-1995 Page Last Updated: 4 December 1995